
<template>
  <div>
    <router-view></router-view>
    <div class="tab-bar" ref="root_tabBar" v-if="store.state.showTabBar">
      <TabBar/>
    </div>
    <div :style="'height:'+tab_bar_height+'px;'" v-if="store.state.showTabBar"></div>
  </div>
</template>
<script lang="ts" setup>
  import TabBar from '@/components/TabBar/index.vue';
  import { ref,onMounted} from 'vue';
  import { useRect } from "@vant/use";
  import store from './store';

  const root_tabBar =ref()
  const tab_bar_height =ref(0)
  onMounted(() => {

     console.log(useRect(root_tabBar).height,store.state.showTabBar,'-----==');
     tab_bar_height.value =useRect(root_tabBar).height
    
  });
</script>

<style lang="scss">
.tab-bar{
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 999;
}
/* #app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
} */

</style>
